<template>
  <view class="container">
	  <uni-nav-bar
	    @clickLeft="goBack"
	    left-icon="back"
	    leftIcon="arrowleft"
	    title="选择地址"
	    statusBar="true"
	    fixed="true"
	    color="#000000"
	    backgroundColor="#ffffff"
	  ></uni-nav-bar>
    <!-- 顶部标题栏 -->
    <!-- <view class="header">
      <text class="title">收货地址</text>
    </view> -->

    <!-- 地址列表 -->
    <view class="address-list" >
      <!-- 地址项 -->
      <view class="address-item" v-for="(item,index) in addressList">
        <view class="left">
          <view class="selected-icon" v-if="item.isDefault === 1">
            <view class="circle active"></view>
          </view>
		  <view class="selected-icon" v-else @click="changeDefaultAddress(item)">
		    <view class="circle noActive"></view>
		  </view>
        </view>
        <view class="center">
          <view class="user-info">
            <text class="name">{{item.consignee}}</text>
            <text class="phone">{{item.phone}} </text>
          </view>
          <view class="address">{{item.detail}}</view>
        </view>
        <view class="right">
          <text class="edit-btn" @click="editAddress(item)">编辑</text>
        </view>
      </view>
    </view>

    <!-- 底部按钮 -->
    <view class="bottom-btns">
      <view class="btn wechat-btn" @click="addNewAddressFromWX()">从微信获取新地址</view>
      <view class="btn add-btn" @click="addNewAddress()">新增收货地址</view>
    </view>

    <!-- 无更多提示 -->
    <view class="no-more">没有更多了</view>
  </view>
</template>

<script src="./index.js"></script>
<style src="./index.scss" lang="scss" scoped></style>
<style scoped>
/* #ifdef MP-WEIXIN || APP-PLUS */
::v-deep ::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
  background: transparent;
  color: transparent;
}

/* #endif */
</style>
